This specification relates to text composition.
Text composition includes laying out text within a frame of one or more pages of an electronic document. Text to be composed typically includes a number of individual paragraphs. Composition of the paragraphs includes a selection and a placement of line breaks to produce a visually pleasing appearance and positioning the paragraph within a page frame of the electronic document. Changes in the style of the text, e.g., fonts, formats, line heights, and point size, can complicate text composition. In addition, text styles and shape complexity can significantly increase computational overhead and processing time.
Techniques exist for determining line breaks in a paragraph (i.e., defining a paragraph layout) during text composition. Many techniques implement a line by line approach. Line by line techniques generally start with a first line, assign penalty values for possible breaks in that line, and choose the best possible line break for that line. After the first line is defined, a second line is analyzed and defined in a similar manner. Line by line techniques continue through a paragraph, defining each line and moving on to the next. Each paragraph is serially processed line by line until the entire text has been composed.
Additionally, paragraphs for which line breaks have been determined can be shuffled within the electronic document. Shuffling involves positioning paragraphs by moving them (e.g., up or down) within the electronic document without redefining the paragraph layout. However, shuffling can only be done if the destination position in the page has the same frame width as the initial position.